# Maintainer: Eivind Uggedal <eu@eju.no>
pkgname=ruby-ttytest
_gemname=ttytest
pkgver=0.5.0
pkgrel=2
pkgdesc="Acceptance test framework for interactive console applications"
url="https://github.com/jhawthorn/ttytest"
arch="noarch"
license="MIT"
depends="ruby tmux"
checkdepends="ruby-minitest ruby-rake ruby-bundler"
source="$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz
	skip-yard.patch
	fix-flaky-test.patch
	gemspec.patch"
builddir="$srcdir/$_gemname-$pkgver"

build() {
	gem build $_gemname.gemspec
}

check() {
	rake test
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install --local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	# Cleanup:
	cd "$gemdir"
	rm -r cache build_info doc
}
sha512sums="30b9f41c8da691178dc9cee66e6fe75c57b3536408d75a6667c1436772103a296e0ec01b2d819592241601e2deae8ebb098a52267fe0e740a35bc039af626fe7  ruby-ttytest-0.5.0.tar.gz
9986cc16c5c30a11cdb92f8d93159bb06dbbc125e1e839d3438b60baabb15b062326116e7e42b9f289a671d91d3f67b90b4f149e0fd86c56b59365b0b36ac4e6  skip-yard.patch
6f1e61c958b754fa2d292c486a366122402a20769156d6a251be47f5cc830ac62d88b70e6dd9984d467dbd87ab103625cec1b7e1f369fc60f7263de887250d60  fix-flaky-test.patch
23dbf425ba8733c6ee91a3809ffab97ec934d1c8c9269105b04bb8b1c3e942cfef417a9ce303e4d5d607d01cb52c83098d0a6c5ddd79aa83274406bbd188704a  gemspec.patch"
